<template>
  <div class="comment">
    <Topnav @click="$router.back(-1)" title="精彩"/>
    <Main
      :commentdata="comment"
      v-for="(comment, index) in commentlist"
      :key="index"
    />
  </div>
</template>

<script>
import Main from "../../components/Comment/Main";
import Topnav from "../../components/Topnav"
export default {
  components: {
      Main,
      Topnav
  },
  data() {
    return {
      commentlist: [],
    };
  },
  mounted() {
    console.log(this.$route.params.id);
  },
  created() {
    this.$axios({
      url: "post_comment/" + this.$route.params.id,
    }).then((res) => {
      console.log(res.data.data);
      // 只要显示三条评论多的就阶段
      this.commentlist = res.data.data;
    });
  },
};
</script>

<style lang="less" scoped>
</style>